package com.basic;

import com.frame.struts.BaseBean;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;
import com.utils.*;
import java.util.Date;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class AssociationAgentForm extends BaseBean {
    public AssociationAgentForm() {
    }
	AssociationAgentEntity aae = new AssociationAgentEntity();
	private String oldId = "";
	public String addAssociationAgent(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		aae.setQyid(qyid);
		aae.setOptdate(new Date());
		aae.setOptrid(CommUtil.getUserId(request));
        try{
		if(factory.addAssociationAgent(aae)){
			    response.sendRedirect(request.getContextPath()+"/gudong/queryAssociationAgent.jsp");
		}else
		{
		response.sendRedirect(request.getContextPath()+"/failed.jsp");
		}
		}
		catch (Exception e) {

		}

			return null;
	}
	public String modifyAssociationAgent(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		aae.setQyid(qyid);
		aae.setOptdate(new Date());
		aae.setOptrid(CommUtil.getUserId(request));
		factory.deleteAssociationAgent(qyid,request.getParameter("xh"));
		try{
		if(factory.addAssociationAgent(aae)){
			    response.sendRedirect(request.getContextPath()+"/gudong/queryAssociationAgent.jsp");
		}
		else{
		response.sendRedirect(request.getContextPath()+"/failed.jsp");
		}
		}
		catch (Exception e) {

		}

			return null;
	}
	
	
	
	
	
	
	
	
	public String getZcdz() {
		return aae.getZcdz();
	}
	public void setZcdz(String zcdz) {
		aae.setZcdz(zcdz);
	}
	public String getLxdh() {
		return aae.getLxdh();
	}
	public void setLxdh(String lxdh) {
		aae.setLxdh(lxdh);
	}
	public String getGlgxsm() {
		return aae.getGlgxsm();
	}
	public void setGlgxsm(String glgxsm) {
		aae.setGlgxsm(glgxsm);
	}
	public String getOldId(){
		return this.oldId;
	}
	public void setOldId(String oldId){
		this.oldId=oldId;
	}

	/**
	 * @return aae.getReturns the cgbl.
	 */
	public double getCgbl() {
		return aae.getCgbl();
	}
	/**
	 * @param cgbl The cgbl to set.
	 */
	public void setCgbl(double cgbl) {
		aae.setCgbl(cgbl);
	}
	/**
	 * @return aae.getReturns the czfs.
	 */
	public String getCzfs() {
		return aae.getCzfs();
	}
	/**
	 * @param czfs The czfs to set.
	 */
	public void setCzfs(String czfs) {
		aae.setCzfs(czfs);
	}
	/**
	 * @return aae.getReturns the frdb.
	 */
	public String getFrdb() {
		return aae.getFrdb();
	}
	/**
	 * @param frdb The frdb to set.
	 */
	public void setFrdb(String frdb) {
		aae.setFrdb(frdb);
	}
	/**
	 * @return aae.getReturns the gljgmc.
	 */
	public String getGljgmc() {
		return aae.getGljgmc();
	}
	/**
	 * @param gljgmc The gljgmc to set.
	 */
	public void setGljgmc(String gljgmc) {
		aae.setGljgmc(gljgmc);
	}
	/**
	 * @return aae.getReturns the optdate.
	 */
	public Date getOptdate() {
		return aae.getOptdate();
	}
	/**
	 * @param optdate The optdate to set.
	 */
	public void setOptdate(Date optdate) {
		aae.setOptdate(optdate);
	}
	/**
	 * @return aae.getReturns the optrid.
	 */
	public String getOptrid() {
		return aae.getOptrid();
	}
	/**
	 * @param optrid The optrid to set.
	 */
	public void setOptrid(String optrid) {
		aae.setOptrid(optrid);
	}
	/**
	 * @return aae.getReturns the qyid.
	 */
	public String getQyid() {
		return aae.getQyid();
	}
	/**
	 * @param qyid The qyid to set.
	 */
	public void setQyid(String qyid) {
		aae.setQyid(qyid);
	}
	/**
	 * @return aae.getReturns the recstate.
	 */
	public String getRecstate() {
		return aae.getRecstate();
	}
	/**
	 * @param recstate The recstate to set.
	 */
	public void setRecstate(String recstate) {
		aae.setRecstate(recstate);
	}
	/**
	 * @return aae.getReturns the remark.
	 */
	public String getRemark() {
		return aae.getRemark();
	}
	/**
	 * @param remark The remark to set.
	 */
	public void setRemark(String remark) {
		aae.setRemark(remark);
	}
	/**
	 * @return aae.getReturns the zcsj.
	 */
	public String getZcsj() {
		return aae.getZcsj();
	}
	/**
	 * @param zcsj The zcsj to set.
	 */
	public void setZcsj(String zcsj) {
		aae.setZcsj(zcsj);
	}
	/**
	 * @return aae.getReturns the zczb.
	 */
	public double getZczb() {
		return aae.getZczb();
	}
	/**
	 * @param zczb The zczb to set.
	 */
	public void setZczb(double zczb) {
		aae.setZczb(zczb);
	}
	/**
	 * @return aae.getReturns the zyyw.
	 */
	public String getZyyw() {
		return aae.getZyyw();
	}
	/**
	 * @param zyyw The zyyw to set.
	 */
	public void setZyyw(String zyyw) {
		aae.setZyyw(zyyw);
	}

}
